import request from "@/utils/request";

// 商品列表
export function listGoodsInfo(query) {
  return request({
    url: "/admin/activityGoods/list",
    method: "get",
    params: query
  });
}

//新增/修改商品
export function saveGoodsInfo(data) {
  return request({
    url: '/admin/activityGoods',
    method: 'post',
    data: data
  })
}

//审核商品
export function editGoodsInfo(data) {
  return request({
    url: "/admin/activityGoods",
    method: "put",
    data: data,
  });
}

// 转售商品列表
export function listResaleGoodsInfo(query) {
  return request({
    url: "/admin/activityResaleGoods/list",
    method: "get",
    params: query
  });
}

// 订单列表
export function listOrderInfo(query) {
  return request({
    url: "/admin/activityOrder/list",
    method: "get",
    params: query
  });
}

// 修改收货地址
export function send(data) {
  return request({
    url: '/admin/activityOrder/send',
    method: 'put',
    data: data
  })
}


// 修改收货地址
export function updateOrder(data) {
  return request({
    url: '/admin/activityOrder',
    method: 'put',
    data: data
  })
}
//地区列表
export function getAreaList(id) {
  return request({
    url: '/system/area/getAreaList?parentId=' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getOrderInfo(orderId) {
  return request({
    url: '/admin/activityOrder/' + orderId,
    method: 'get'
  })
}

// 商品列表
export function getActivityStatistics(query) {
  return request({
    url: "/admin/activityTime/statistics",
    method: "get",
    params: query
  });
}

